﻿using RockBus.DataContracts;
using RockBus.Transport.Interfaces;
using System;

namespace RockBus.Transport.File
{
    public class FileTransportFactory : ITransportFactory
    {
        public string TransportName { get { return TransportTypeEnum.FileTransport.ToString(); } }

        public ITransport CreateTransport(EndpointInfo endpointInfo)
        {
            switch (endpointInfo.ExchangeType)
            {
                case ExchangeTypeEnum.OneWay:
                case ExchangeTypeEnum.OneWayRequestResponse:
                    return new FileTransport(endpointInfo);

                default:
                    throw new NotImplementedException("No such thing as two-way FILE transport.");
            }
        }
    }
}